//引入express
const express = require('express');
//引入dotenv
const dotenv = require('dotenv');
//引入路由文件
const mscamps = require('./routes/mscamps');
//引入中间件
// const logger = require('./middleware/logger');
const morgan = require('morgan');
// 引入colors
const colors = require('colors');
//环境变量配置
dotenv.config({
    //路径
    path: './config/config.env',
});

//定义应用
const app = express();

//应用
app.use(morgan("dev"));
// app.use(logger);

//挂载路由
app.use("/api/v1/mscamps", mscamps);

//定义端口
const PORT = process.env.PORT || 3000;
//监听端口
app.listen(PORT, console.log(`Server running in ${ process.env.NODE_ENV } mode on port ${ PORT }`));